package com.ygl.consumer.controller;

import com.ygl.consumer.util.JwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author yanggld
 * @Date 2019/12/2-16:25
 * @Description
 */
@RequestMapping("/login")
@RestController
public class LoginController {

	@Autowired
	private JwtUtil jwtUtil;

	@GetMapping("/jwt")
	public String login(){
		Map<String, Object> claims = new HashMap<>();
		claims.put("userId","001");
		claims.put("tenantId","001");
		return jwtUtil.generateToken(claims);
	}

	@GetMapping("/test")
	public String test(){
		return "test";
	}
}
